package com.cloud.netty.tcp;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;

/**
 * @program: netty
 * @description:
 * @author: Cloud
 * @create: 2022/4/14 14:17:15
 */
public class ClientInitializer extends ChannelInitializer<SocketChannel> {

    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline();

        // 将自定义的处理器加入到管道中
        pipeline.addLast(new ClientHandler());
    }
}
